package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.StationNeeds;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmy.cultivate.entity.SchoolNeeds;
import com.xmy.cultivate.entity.StationNeeds;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 招聘岗位表 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-06-07
 */
public interface StationNeedsMapper extends BaseMapper<StationNeeds> {


    @Select({"<script>",
                "SELECT GROUP_CONCAT(id) as ids",
                "FROM adms_station_needs ",
                "WHERE 1=1",
                "<when test='type!=null and type!=&apos;&apos; and type != 0'>",
                    "AND type = ${type}",
                "</when>",
                "<when test='labourId!=null and labourId!=&apos;&apos; '>",
                    "AND labour_id IN (${labourId})",
                "</when>",
                "<when test='stationId!=null and stationId!=&apos;&apos; '>",
                    "AND station_id IN (${stationId})",
                "</when>",
                "<when test='departmentId!=null and departmentId!=&apos;&apos; '>",
                    "AND department_id IN (${departmentId})",
                "</when>",
            "</script>"})
    String getIdsByLabourId(@Param("type") Integer type,
                            @Param("labourId") String labourId,
                            @Param("stationId") String stationId,
                            @Param("departmentId") String departmentId);
}
